package boardgamer.common.client.animation;

import android.graphics.Canvas;


/**
 * {@link BlockingAnimation} that does nothing except blocking
 */
public class WaitAnimation extends BlockingAnimation {

  private static final int PERIOD = 1;

  private int waitTime;

  public WaitAnimation(int waitTime) {
    super(PERIOD);
    this.waitTime = waitTime;
  }

  @Override
  public boolean isDead() {
    return waitTime <= 0;
  }

  @Override
  public boolean isBlocking() {
    return !isDead();
  }

  @Override
  public void draw(Canvas canvas) { }

  @Override
  protected void onPeriodic() {
    this.waitTime -= PERIOD;
  }
}
